package GUI;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author CAMILO
 */
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.image.BufferedImage;
import javax.swing.*;
import javax.swing.border.Border;

public class BgBorder implements Border {
    
    private BufferedImage img = null;
    
    public BgBorder(BufferedImage img1){
        
        img = img1;
        
    }

    @Override
    public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
        
        if(img != null){
            
            g.drawImage(img, 0, 0, width, height, null);
            
        }
        
    }

    @Override
    public Insets getBorderInsets(Component c) {
        return new Insets(0,0,0,0);
    }

    @Override
    public boolean isBorderOpaque() {
        return false;
    }
}
